import torch

model = torch.hub.load("facebookresearch/dinov2", "dinov2_vitb14_reg")
model.eval()

# 使用 TorchScript 导出模型
scripted_model = torch.jit.script(model)
scripted_model.save("dinov2_vitb14_reg_scripted.pt")